import {createRouter, createWebHashHistory, createMemoryHistory} from 'vue-router';
import Home from '../views/Home.vue';
import Log from '../views/LogView.vue';
import Team from '../views/MyTeam.vue';
import MyTeam from '../views/TeamView.vue';
import Index from '../views/Index.vue';
import Announcement from '../views/Announcement.vue';
import MyWallet from '../views/MyWallet.vue';
import ReleaseRecord from '../views/ReleaseRecord.vue';
import CashCoupon from '../views/CashCoupon.vue';
import RewardRecord from '../views/RewardRecord.vue';
import CurrencyDetails from '../views/CurrencyDetails.vue';
import PledgeRecord from '../views/PledgeRecord.vue';

const router = createRouter({
  // history: createMemoryHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      meta: {
        title: 'AVM',
        keepAlive: false,
      }
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      meta: {
        title: 'AVM'
      }
    },
    {
      path: '/log',
      name: 'log',
      component: Log,
      meta: {
        title: ''
      }
    },
    {
      path: '/team',
      name: 'team',
      component: Team,
      meta: {
        title: '团队明细'
      }
    },
    {
      path: '/my_team',
      name: 'my_team',
      component: MyTeam,
      meta: {
        title: '我的团队'
      }
    },
    {
      path: '/announcement',
      name: 'announcement',
      component: Announcement,
      meta: {
        title: '公告'
      }
    },
    {
      path: '/my_wallet',
      name: 'my_wallet',
      component: MyWallet,
      meta: {
        title: '我的钱包'
      }
    },
    {
      path: '/release_record',
      name: 'release_record',
      component: ReleaseRecord,
      meta: {
        title: '释放记录'
      }
    },
    {
      path: '/cash_coupon',
      name: 'cash_coupon',
      component: CashCoupon,
      meta: {
        title: '我的现金券'
      }
    },
    {
      path: '/reward_record',
      name: 'reward_record',
      component: RewardRecord,
      meta: {
        title: '奖励记录'
      }
    },
    {
      path: '/currency_details',
      name: 'currency_details',
      component: CurrencyDetails,
      meta: {
        title: ''
      }
    },
    {
      path: '/pledge_record',
      name: 'pledge_record',
      component: PledgeRecord,
      meta: {
        title: '质押记录'
      }
    },
     {
      path: '/RechargeRecord',
      name: 'RechargeRecord',
      component: ()=>import('@/views/RechargeRecord.vue'),
      meta: {
        title: '充值记录'
      }
    },
    {
      path: '/BuyRecord',
      name: 'BuyRecord',
      component: () => import('@/views/BuyRecord.vue'),
      meta: {
        title: '购买记录',
      },
    },

  ]
})

export default router
